package com.sfeir.tv.client.mvc.framework;

public abstract class AbstractInitializable implements Initializable
{
    private boolean initialized;

    final public void init()
    {
        if( !this.initialized ) performInit();
    }

    private void performInit()
    {
        pre();
        doInit();
        post();
        setInitialised();
    }

    private void setInitialised()
    {
        this.initialized = true;
    }

    public void resetInitialised()
    {
        this.initialized = false;
    }

    public void pre()
    {

    }

    public void doInit()
    {

    }

    public void post()
    {

    }
}